-
Notifications
You must be signed in to change notification settings - Fork 900
bugfix: Setting OMPI_MPI_THREAD_LEVEL to a value different than requested crashes #13211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
bugfix: Setting OMPI_MPI_THREAD_LEVEL to a value different than requested crashes #13211
Conversation
b71461f
to
b481893
Compare
ompi/mpi/c/init_thread.c.in
Outdated
*/ | ||
if (NULL != (env = getenv("OMPI_MPI_THREAD_LEVEL"))) { | ||
int env_required = atoi(env); | ||
err_arg_required = err_arg_required || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env_arg_required |= ...etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My biggest concern here is that the user is required to know the valid thread level values as defined in the MPI ABI header. We should keep doing what we do right now, aka 0-3, and use a shift operation to convert it to the ABI value env_required = (1 << (10 + atoi(env)));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, the valid values are still [0-3] (because our internal ABI is not the same as the standardized ABI (yet?), I'll add this consideration to the comment requested by Jeff so we don't forget when the time comes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW: we plan to support both the existing OMPI ABI and the official MPI Forum MPI ABI. Hence, we'll probably want code that can handle both situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the important part is that we don't want the users to have to enter the ABI values for the environment variable for the thread level. We want this to remain indexed as it is today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Good point.
Maybe we should also accept strings? MPI_THREAD_SINGLE
, MPI_THREAD_MULTIPLE
, ... etc. I.e., something that doesn't depend on a numeric value.
b481893
to
1a0d2f7
Compare
Hello! The Git Commit Checker CI bot found a few problems with this PR: 1a0d2f7: review comments
Please fix these problems and, if necessary, force-push new commits back up to the PR branch. Thanks! |
1a0d2f7
to
8ad7579
Compare
`requested` in `MPI_Init_thread` would invoke the error handler, even though it is an useful override in some threaded library use cases. Signed-off-by: Aurelien Bouteiller <[email protected]>
8ad7579
to
fe5d20e
Compare
Setting OMPI_MPI_THREAD_LEVEL to a value different than
requested
inMPI_Init_thread
would invoke the error handler, even though it is an useful override in some threaded library use cases.